package com.phiture.erp.produce.core.service;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import com.phiture.erp.produce.core.pojo.vo.ErpProduceRoutingPageReqVO;
import com.phiture.erp.produce.core.pojo.vo.ErpProduceRoutingSaveReqVO;
import com.phiture.erp.produce.dal.entity.ErpProduceProcessDO;
import com.phiture.erp.produce.dal.entity.ErpProduceRoutingDO;
import com.phiture.erp.produce.dal.entity.ErpProduceRoutingDetailDO;

import javax.validation.Valid;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 工艺路线 Service 接口
 *
 * @author lekaihuai
 */
public interface ErpProduceRoutingService {

    /**
     * 创建工艺路线
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createProduceRouting(@Valid ErpProduceRoutingSaveReqVO createReqVO);

    /**
     * 更新工艺路线
     *
     * @param updateReqVO 更新信息
     */
    void updateProduceRouting(@Valid ErpProduceRoutingSaveReqVO updateReqVO);

    /**
     * 删除工艺路线
     *
     * @param id 编号
     */
    void deleteProduceRouting(Long id);

    /**
     * 获得工艺路线
     *
     * @param id 编号
     * @return 工艺路线
     */
    ErpProduceRoutingDO getProduceRouting(Long id);

    /**
     * 获得工艺路线分页
     *
     * @param pageReqVO 分页查询
     * @return 工艺路线分页
     */
    PageResult<ErpProduceRoutingDO> getProduceRoutingPage(ErpProduceRoutingPageReqVO pageReqVO);

    Map<Long, String> getProduceRoutingMap(Long materialId);
    Map<Long, Long> getProduceRoutingMap(Collection<Long> materialIds);

    // ==================== 子表（工艺路线明细） ====================

    /**
     * 获得工艺路线明细列表
     *
     * @param routingId 工艺路线ID
     * @return 工艺路线明细列表
     */
    List<ErpProduceRoutingDetailDO> getProduceRoutingDetailListByRoutingId(Long routingId);

    List<ErpProduceProcessDO> getProduceRoutingDetailListByMaterialId(Long materialId);

}